// DriveNotes. Copyright (c) 2011, Andrei Senchuk. All rights reserved.
package net.taviscaron.drivenotes.server.service.endpoint;

import java.util.List;
import javax.jws.WebMethod;
import javax.jws.WebService;
import net.taviscaron.drivenotes.shared.exceptions.InvalidEntityException;
import net.taviscaron.drivenotes.shared.model.entity.Car;
import net.taviscaron.drivenotes.shared.model.entity.Service;
import net.taviscaron.drivenotes.shared.service.ServiceService;
import org.springframework.beans.factory.annotation.Autowired;

/**
 * Service service impl
 * @author Andrei Senchuk
 */
@WebService(serviceName = "ServiceService")
public class ServiceServiceEndpoint implements ServiceService {
    @Autowired
    private ServiceService serviceService;

    @WebMethod
    public List<Service> findServicesByCar(Car car) {
        return serviceService.findServicesByCar(car);
    }

    @WebMethod
    public void saveService(Service service) throws InvalidEntityException {
        serviceService.saveService(service);
    }

    @WebMethod
    public Service findById(Long id) {
        return serviceService.findById(id);
    }

    @WebMethod
    public void removeServiceById(Long id) {
        serviceService.removeServiceById(id);
    }
}
